Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Masp vp parallel verification #2972

Merged
merged 7 commits into from
May 31, 2024
Merged

Conversation

grarco
Copy link
Contributor

@grarco grarco commented Mar 28, 2024

Describe your changes

Closes #2959.

Parallelize the masp vp verification step.

Currently this doesn't work. The parallel verification process succeeds for every check (even the proofs) except for the signature one and more specifically for the final check on the result point being of small order (https://github.com/ZcashFoundation/reddsa/blob/56d52195608f3830f027f7109176a30175a5c1aa/src/batch.rs#L272)

To get batch signature verfication to work, the following three issues needed fixing:

  • In computing the nonce for RedDSA, the concatenation of public key and msg does not need to be handled in the masp crate, this is done automatically by From<...> impl
  • The H* function which hashes data to elliptic curve points has a different personalization ("Zcash_RedjubjubH" vs "MASP__RedjubjubH")
  • The batch verification assumes a different basepoint than the MASP does.

The latter two issues are the most inconvenient. We can either change our personalization and basepoints to match the RedDSA assumptions, or we must fork that crate

Indicate on which release or other PRs this topic is based on

v0.37.0

Checklist before merging to draft

  • I have added a changelog
  • Git history is in acceptable state

Copy link

codecov bot commented Mar 28, 2024

Codecov Report

Attention: Patch coverage is 0% with 78 lines in your changes are missing coverage. Please review.

Project coverage is 53.94%. Comparing base (6dc1612) to head (15affec).
Report is 2 commits behind head on main.

Files Patch % Lines
crates/sdk/src/masp.rs 0.00% 78 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2972      +/-   ##
==========================================
+ Coverage   53.89%   53.94%   +0.05%     
==========================================
  Files         314      314              
  Lines      105704   105597     -107     
==========================================
  Hits        56968    56968              
+ Misses      48736    48629     -107     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@grarco grarco force-pushed the grarco/masp-parallel-verification branch from 5dd3e6a to ad6b35a Compare April 4, 2024 21:46
@grarco grarco mentioned this pull request Apr 9, 2024
@grarco grarco force-pushed the grarco/masp-parallel-verification branch from ad6b35a to 5b72670 Compare April 11, 2024 18:03
@grarco grarco force-pushed the grarco/masp-parallel-verification branch from 2999a49 to dea5d4b Compare May 15, 2024 09:58
@grarco grarco force-pushed the grarco/masp-parallel-verification branch 2 times, most recently from 593e18a to b4d49d1 Compare May 17, 2024 17:25
grarco added a commit that referenced this pull request May 22, 2024
@grarco grarco force-pushed the grarco/masp-parallel-verification branch from b4d49d1 to 7cc4d90 Compare May 22, 2024 12:50
@grarco grarco marked this pull request as ready for review May 22, 2024 13:46
@grarco grarco requested review from batconjurer and murisi May 22, 2024 13:46
@grarco grarco force-pushed the grarco/masp-parallel-verification branch from 7cc4d90 to 15affec Compare May 24, 2024 07:59
brentstone added a commit that referenced this pull request May 28, 2024
* grarco/masp-parallel-verification:
  Changelog #2972
  Updates masp gas costs
  Reworks gas metering for masp validation
  Fixes masp benchmarks
  Updates masp dep. Patch reddsa dep
  Updates benchmarks for parallel masp verification
  Run masp verification in parallel
brentstone added a commit that referenced this pull request May 30, 2024
* origin/grarco/masp-parallel-verification:
  Changelog #2972
  Updates masp gas costs
  Reworks gas metering for masp validation
  Fixes masp benchmarks
  Updates masp dep. Patch reddsa dep
  Updates benchmarks for parallel masp verification
  Run masp verification in parallel
@brentstone brentstone merged commit 6d2f5bf into main May 31, 2024
16 of 19 checks passed
@brentstone brentstone deleted the grarco/masp-parallel-verification branch May 31, 2024 02:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MASP parallel verification
3 participants